<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>待筛简历</title>
<script type="text/javascript" src="static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="static/easyui/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" href="static/easyui/themes/icon.css">
<link rel="stylesheet" href="static/easyui/themes/metro-red/easyui.css">
</head>
<body>
<style type="text/css">
#rbio{
		width: 100%;
		margin:auto;
	    overflow-x: auto;
	    margin-top: 5px;
	    border-collapse: collapse;
	    border: 1px solid #e4e7ec;
	    background-color: #fff;
   		color: gray;
   		font-size:12px; 
	}
	#rbio thead{
		color: #19AA8D;
	    font-size: 14px;
	    font-weight: 700;
	} 
	#rbio th{
		background: #6666661a;
	}
	#rbio td{
		border: 1px solid #e4e7ec;
		width: 150px;
		height: 50px;
	}
.datagrid-header-row td{
		background: #E6E6E6;
		color: #19AA9C;
	    font-size: 14px;
	    font-weight: 700;
	    text-align: center;
	}
	.datagrid-row td{
		background: #fff;
		font-size: 12px;
		text-align: center;
	}	
	.frhsz{
		color:white;
		cursor: pointer;
		border:none;
	}
	.icon-biographical-shanchu{
		padding-left:20px;
		background:url('static/easyui/themes/icons/shanchu.png') no-repeat 5% 50%;
		background-color:#FF0000;
	}
	.icon-biographical-xinzeng{
		width:20px;
		float:left;
		background:url('static/easyui/themes/icons/xinzeng.png') no-repeat 5% 50%;
	}
	.icon-bio-chakan{
		padding-left: 20px;
		background:url('static/easyui/themes/icons/chakan.png') no-repeat 5% 50%;
		background-color:#1AB394;
}
	.icon-bio-fasong{
		padding-left: 20px;
		background:url('static/easyui/themes/icons/fasong.png') no-repeat 5% 50%;
		background-color:#1AB394;
}
.informs{
	margin-left:20px;
}
	.xinzeng{
		width:60px;
		color:white;
		background-color:#19AA8D;
		margin:5px 50px;
		cursor: pointer;
		border:none;
	}
	.biolooks{
		color:white;
		cursor: pointer;
		border:none;
}
	.bio-serch{
		width:300px;
		float:right;
		margin-top:2px;
	}

#biographicallooks{
	width:620px;
	height:240px;
	border:solid 1px #DADADA;
	margin:auto;
}
.insertcontents{
	width:600px;
	height:180px;
	margin-top:10px;
}
.insert-left{
	width:210px;
	height:180px;
	float:left;
	margin-left:40px;
}
.insert-right{
	width:240px;
	height:180px;
	float:right;
	margin-right:20px;
}
#creater{
	margin-left:12px;
}
#interviews{
	margin-left:-12px;
}
#bioid,#bioname,#bioage,#biosex,#biostudy,#bioeamil,#biophone,#bioposition,#bioadress,#biomark{
	width:170px;
	margin-bottom: 10px;
}
.bioanniu{
	margin-right:10px;
	width:100px;
	height:30px;
	float:right;
}
#bioclose{
	width:60px;
	background-color:#17AA8D;
	cursor: pointer;
	color:white;
}
.second-one{
		width:1100px;
		margin:10px auto;
}
#biographical-insert{
		width:60px;
		height:22px;
		color:white;
		cursor: pointer;
	}
.icon-bio-xiugai{
		padding-left: 20px;
		border:none;
		background:url('static/easyui/themes/icons/bianji.png') no-repeat 5% 50%;
	}
	.icon-biographical-xinzeng{
		padding-left: 20px;
		border:none;
		background:url('static/easyui/themes/icons/edit_add.png') no-repeat 5% 50%;
	}
#xgbio{
	width:400px;
	height:140px;
	margin:auto;
	background:white;
}
#reasytime{
	width:170px;
}
.xgqx{
	width:60px;
	margin-left:30px;
	height:20px;
	border:solid 1px black;
	color:black;
	background-color:white;
	cursor: pointer;
}
.xgqd{
	width:60px;
	margin-left:40px;
	height:20px;
	border:none;
	color:white;
	background-color:#18A689;
	cursor: pointer;
}
</style>
<script type="text/javascript">		
function add(text){   
	$("#content-admin").panel({
		href:text
	})
}
function suo(name,id){
	$("#rbio").datagrid({
	    url:'select-resume',
	    queryParams:{
	    	reasyname:name,
	    	reasyid:id
	    },
	    columns:[[
	    	{field:'aa',checkbox:true,title:'选择',width:50},
	    	{field:'reasyid',hidden:true,title:'编号',width:100},
	    	{field:'riviewid',hidden:true,title:'编号',width:100},
	    	{field:'biogra',title:'序号',width:80},
	    	{field:'reasyname',title:'姓名',width:120},
	    	{field:'position_name',title:'应聘职位',width:170},
	    	{field:'reasytime',title:'计划面试时间',width:200},
	    	{field:'rapplyname',title:'所属申请计划',width:200},
	    	{field:'caozuo',title:'操作',width:300,align:'center',
				formatter: function(value,row,index){
					return "<input type='button' class='biolooks icon-bio-chakan' onclick='bioxiang("+row.reasyid+")' style='width:80px;height: 20px;font-size:12px;border-radius:4px;color:#fff;background-color:#18A689;cursor: pointer;' value='查看详情'/>"+
					"<input type='button' class='xiugai icon-bio-xiugai' onclick='bioxg("+row['reasyid']+")' style='width:60px;height: 20px;font-size:12px;border-radius:4px;color:#fff;margin-left:15px;background-color:#18A689;cursor: pointer;border:none;' value='修改'/>"+
					"<input type='button' class='informs icon-bio-fasong' onclick='tongzhi("+row.riviewid+","+row.reasyid+")' style='width:80px;height: 20px;font-size:12px;border-radius:4px;color:#fff;background-color:#18A689;cursor: pointer;border:none;' value='通知面试'/>";
				},
			}
	    	]],		          
	          pagination:true,      
			    pageNumber:1,
			    pageSize:5,
			    pageList:[5,10,15]
	    });	
}
$(function(){
	suo(null,1);
});
//搜索
function sousuo(value,name){   
	suo($(".easyui-searchbox").val(),0);
}   
	
	/*点击新增按钮跳转到新增界面*/
	$("#biographical-insert").click(function(){
		add("recruitinsert");
	})  		
	//遮罩层隐藏
	$("#zhezhao").hide();
	//查看详情
	function  bioxiang(reasyid){
		$("#bioid").val("");
		$("#bioname").val("");
		$("#bioage").val("");
		$("#biosex").val("");
		$("#biostudy").val("");
		$("#bioeamil").val("");
		$("#biophone").val("");
		$("#bioposition").val("");
		$("#bioadress").val("");
		$("#biomark").val("");
		
		$("#biographicallooks").window("open");
		//显示遮罩层
		  $("#zhezhao").show();
		
		$.ajax({
					url:"bio-xiangq",
					type:"post",
					data:{
						"reasyid":reasyid
					},
					//从数据库获取简历数据
					success:function(data){
						$("#bioid").val(data[0]["reasyid"]);
						$("#bioname").val(data[0]["reasyname"]);
						$("#bioage").val(data[0]["reasyage"]);
						$("#biosex").val(data[0]["reasysex"]);
						$("#biostudy").val(data[0]["reasyacademic"]);
						$("#bioeamil").val(data[0]["reasyemail"]);
						$("#biophone").val(data[0]["reasyphone"]);
						$("#bioposition").val(data[0]["reasybirthday"]);
						$("#bioadress").val(data[0]["reasyadress"]);
						$("#biomark").val(data[0]["reasyremark"]);
					}
		});
	}
	//点击关闭按钮
   $("#bioclose").click(function(){
	   $("#biographicallooks").window("close");
	   //隐藏遮罩层
	   $("#zhezhao").hide();
   }); 	
	 	//点击通知按钮弹框
		function tongzhi (id,rid){			
				   $.ajax({
						 type:"post",
						  url:"email",
						  data:{"id":id,"rid":rid},
						  success:function(res){
							if(res==1){
								alert("通知成功");
							}else{
								alert("发送失败，此邮箱错误");
							}
						  }
					});			
		} 	
	 	//修改计划面试时间
	 	$("#zhezhao").hide();
	 	function bioxg(id){
	 		$("#xgbio").window("open");
			 $("#zhezhao").show();
			 $.ajax({
					url:"bio-allbio",
					type:"get",
					dateType:"json",
					data:{reasyid:id},
					success: function (result) {
						//id
						$("#reasyid").val(result[0]["reasyid"]);	
						//计划面试时间
						$("#reasytime").datebox("setValue",result[0]["reasytime"]);
					}
					});
				//点击确定
				$("#yesok").click(function(){
					var reasyid = $("#reasyid").val()
					var reasytime = $("#reasytime").val();
					 $.ajax({
							url:"bio-xiugais",
							type:"post",
							data:{
								"reasyid":reasyid,
								"reasytime":reasytime
							},
							success:function(result){	
								
							}
					 });
					 $("#xgbio").window("close");
					 $("#zhezhao").hide();
					 suo(null,1);
				});
	 	}
		/*点击编辑中的取消*/
		$("#notok").click(function(){
		$("#xgbio").window("close");
		 $("#zhezhao").hide();
	});
		/* //点击窗口自带的关闭按钮关闭窗口(修改)
		   $(document).ready(function(){		    
			   $('#xgbio').window({
			       onBeforeClose:function(){ 
			    	   $("#zhezhao").hide();
			       }
			   });
			}); */
		 //点击窗口自带的关闭按钮关闭窗口(查看详情)
		   $(document).ready(function(){		    
			   $('#biographicallooks').window({
			       onBeforeClose:function(){ 
			    	   $("#zhezhao").hide();
			       }
			   });
			});
</script>
	<div class="biographical">
		<div class="first-one" style="height:30px;margin:10px auto;">
			<button id="biographical-insert" class="xinzeng icon-biographical-xinzeng"></button>
			<div class="bio-serch">
			<input class="easyui-searchbox" searcher="sousuo" style="width:240px;" data-options="prompt:'姓名'"></input>
			</div>
		</div>	
		<div class="second-one">
			<table id="rbio" class="easyui-datagrid" data-options="width:1100,height:300">
			</table>
		</div>		
</div>

<!-- 查看详情界面 -->
<div id="zhezhao" style="width:1366px;height:736px;position:fixed; top:0px;
background: rgba(0, 0, 0, 0.5);text-align:center;left:0;z-index:10;display:none;" >
<div id="biographicallooks" class="easyui-window" title="录用人简历" data-options="closed:true,minimizable:false,maximizable:false,collapsible:false">	
		<div class="insertcontents">
		<div class="insert-left">
			<form id="left" method="post">
				<span>编号：</span><input type="text" id="bioid" name="reasyid" value="${pojos.reasyid }">
				<span>姓名：</span><input type="text" id="bioname" name="reasyname" value="${pojos.reasyname }">
				<span>年龄：</span><input type="text" id="bioage" name="reasyage" value="${pojos.reasyage }">
				<span>性别：</span><input type="text" id="biosex" name="reasysex" value="${pojos.reasysex }">
				<span>学历：</span><input type="text" id="biostudy" name="reasyacademic" value="${pojos.reasyacademic }">
			</form>
		</div>
		<div class="insert-right">
			<form id="right" method="post">
				<span>家庭住址：</span><input type="text" id="bioadress" name="reasyadress" value="${pojos.reasyadress }">
				<span>手机号码：</span><input type="text" id="biophone" name="reasyphone" value="${pojos.reasyphone }">
				<span>出生年月：</span><input type="text" id="bioposition" name="reasybirthday" value="${pojos.reasybirthday }">
				<span>电子邮箱：</span><input type="text" id="bioeamil" name="reasyemail" value="${pojos.reasyemail }">
				<span>添加备注：</span><input type="text" id="biomark" name="reasyremark" value="${pojos.reasyremark }">
			</form>
		</div>
	</div>
	<div class="bioanniu"><button id="bioclose">关闭</button></div>
</div>
</div>

<!-- 修改 --> 
<div id="zhezhao" style="width:1366px;height:736px;position:fixed; top:0px;
background: rgba(0, 0, 0, 0.5);text-align:center;left:0;z-index:10;display:none;" >
	<div id="xgbio" class="easyui-window" title="修改" data-options="closed:true,minimizable:false,maximizable:false,collapsible:false">		
		<div class="xgnr" style="width:280px;height:50px;margin:10px auto;">
		<input type="hidden" id="reasyid"/>
		 <form id="centerxg" method="post">
			<span style="font-size:14px;">计划面试时间：<input id="reasytime" type="text" class="easyui-datebox xgtime" name="reasytime" value="${pojos.reasytime }" required="required"></span>
		</form>
		</div>
		<div class="xgbottom" style="width:200px;height:30px;margin:25px auto;">
			<button id="notok" class="xgqx">取消</button>
			<button id="yesok" class="xgqd">确定</button> 		
	</div>
	</div>
</div>		
</body>
</html>